Repository navigation
Turing: add small-BAR1 Metal rules and optional kext patch tool - #179
Open
Golopmoui3 wants to merge 1 commit into
Open
Golopmoui3 wants to merge 1 commit into
Golopmoui3 wants to merge 1 commit into
Conversation
Turing GPUs (TU104/TU106/TU116) with a 256 MB BAR1 aperture can stutter or drop WindowServer surfaces under Metal buffer pooling and VRAM headroom exhaustion. - Add turing-bar1-stutter-optimization to mac/Resources/nullmoth-rules.json so nullmoth-setup.sh applies the nvrm610.conf knobs through the standard per-system rules path without altering signed or SHA-256-pinned kexts. - Move the optional NVAccel/NVRMFB binary patches into standalone tools/apply-turing-fix.sh with macOS 15, driver 3.0, Turing PCI ID, SIP, Mach-O, byte-pattern, and SHA-256 backup verification plus AuxKC rollback on failure. - Add technical notes in docs/TURING_OPTIMIZATION.md and unit tests in tests/test_turing_stutter_rules.py. Tested on AMD Ryzen 5 5600 + NVIDIA GeForce RTX 2060 SUPER (TU106, 10de:1f06) running macOS 15.8.3. Signed-off-by: Golopmoui3 <200087690+Golopmoui3@users.noreply.github.com>
Golopmoui3
force-pushed
the
fix/turing-stutter-optimization
branch
from
November 28, 2026 07:21
0287bf4 to
4151054
Compare
Author
|
Rebased onto the latest
Ready for CI approval and review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
On Turing GPUs (TU104/TU106/TU116) with a 256 MB BAR1 window, WindowServer dragging can stutter, drop surfaces, or show black window rectangles when Metal buffer pooling and VRAM headroom exhaust the aperture. On driver 3.0 (macOS 15),
NVRMFBalso hits a 256 MBvramGrantcap (0x21ea3) andNVAcceltriggers idle surface eviction (gSurfGpuOnat0x251e0) and sticky VM churn (gVmStickyat0x23f1c).What this changes
mac/Resources/nullmoth-rules.json: addsturing-bar1-stutter-optimizationmatching{"arch": ["turing"]}sonullmoth-setup.shwrites thenvrm610.confMetal knobs (NVMTL_VRAM_HEADROOM_MB=48,NVMTL_NO_SURFACE_PAGEOFF=0, disabled reuse/grace pools,NVMTL_GSUB_HOSTPTR_LIFT=1, etc.) through the standard per-system rules block without altering signed or SHA-256-pinned kext binaries.tools/apply-turing-fix.sh: moves the optionalNVRMFB/NVAccelbinary patches into a standalone opt-in script (--check,--apply,--conf-only,--revert) instead of patching kexts insidenullmoth-setup.sh. Verifies root, SIP filesystem status, macOS15, driver3.0, Turing PCI ID (1e00..21ff), 64-bit Mach-O headers, optional--accel-sha256/--fb-sha256pins, and exact target bytes before touching files; storesSHA256SUMS-checked backups under/Library/NullMoth/turing-backup/and checkskmutil inspectwith automatic rollback on failure.docs/TURING_OPTIMIZATION.md: documents the BAR1 Metal rules and optional tool usage.tests/test_turing_stutter_rules.py: verifies rule matching/knob formatting, confirmsnullmoth-setup.shdoes not modify kext binaries, and checks the standalone tool's version/checksum/rollback guards.How I tested it
10de:1f06, TU106, 256 MB BAR1) on macOS 15.8.3 (x86_64): window dragging runs smoothly at 60 FPS with no black surfaces or WindowServer hitches and working NVENC.sh -n tools/apply-turing-fix.sh,tools/apply-turing-fix.sh --help, andpython -m unittest -v tests.test_turing_stutter_rules tests.test_nvenc_rule_generations tests.test_every_option_has_a_place tests.test_driver_optins_have_a_home(16/16 passed). Fulltests/discovery ran on Windows (1144 tests: 0 failures, 8 skipped, 7 Windows-environment errors from missing C compiler / symlink privileges).mac/tools/andmac/build.shwere not run locally (no macOS host).